package post_to_in_pkg.lexer;


public class Token {
	String lexeme="";
    public Tag tag;
    public int inline;
	public Token(String s, Tag arg_tag) {
		lexeme=s; 
		tag=arg_tag;
	}
	
	public Token(String s, Tag arg_tag,int line) {
		lexeme=s; 
		tag=arg_tag;
		inline=line;
	}
	
	public String toString() {
		return lexeme;
	}
	
	public boolean isNotNull() {
		return tag!=Tag.NULL;
	}
	
	public boolean isSaved() {
		return tag==Tag.OP_SAVED;
	}
	
	public boolean isOPKey() {
		return tag==Tag.OP_KEY;
	}
	
	public boolean equals(Token tok) {
		if(tag!=Tag.NULL)
			return lexeme.equals(tok.toString());
		return tok.tag==tag.NULL;
	}
	
	public static final Token Null=new Token("",Tag.NULL);
}
